Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(toDash): Hoist duplicates from Representation to AdaptationSet #431

Merged
merged 1 commit into from
Jul 11, 2023

Conversation

absidue
Copy link
Collaborator

@absidue absidue commented Jul 6, 2023

According to the DASH specification, codecs, audioSampleRate, frameRate and AudioChannelConfiguration are all allowed to appear at the AdaptationSet level not just the Representation one. We can use that to slightly reduce the size of the manifests by specifying it on the AdaptationSet, instead of each Representation, if the value would be identical for every Representation in that AdaptationSet.

Examples of situations that can be useful in:

  1. The representations in WebM adaptation sets tend to all have the same codec e.g. opus, vp9 and vp9.2 (HDR), so it makes sense to hoist the codecs attribute
  2. For 4k+ 60fps HDR videos the vp9.2 streams all tend to keep the original 60fps frame rates, so it makes sense to hoist the frameRate attribute

This doesn't massively reduce the size of the manifests, as the majority of the size is occupied by YouTube's very long streaming URLs. I do have an idea I want to try though, having a BaseURL element at the AdaptationSet level with a common prefix for the URLs in the BaseURLs in the Represenation, this will need lots of experimentation, as developer specified URLTransformer function could produce all sorts of wacky URLs. Another thing to watch out for is OTF formats, as they use SegmentTemplates instead of specifying a BaseURL but would still be affected by BaseURL elements on the AdaptationSet.
TL;DR: The streaming URLs are the biggest contributor to the manifest size, I have an idea to shrink them but will need a lot of experimentation so it doesn't break anything.

@absidue absidue changed the title feat(toDash): Hoist duplicates from Representation to AdaptationSet perf(toDash): Hoist duplicates from Representation to AdaptationSet Jul 6, 2023
@LuanRT
Copy link
Owner

LuanRT commented Jul 11, 2023

Looks like this has some conflicts that need to be resolved. Anywho, I already reviewed it and it looks good!

@absidue
Copy link
Collaborator Author

absidue commented Jul 11, 2023

Fixed the conflicts, looks like I managed to create to create two conflicting pull requests, sorry about that.

@LuanRT LuanRT merged commit 5f058e6 into LuanRT:main Jul 11, 2023
@absidue absidue deleted the dash-hoisting branch July 11, 2023 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants